/* 动画效果 */
@keyframes highlight {
  0% {
    background-color: transparent;
  }

  50% {
    background-color: rgba(59, 130, 246, 0.2);
  }

  100% {
    background-color: transparent;
  }
}

.hash-bit-changed {
  animation: highlight 1s ease-in-out;
}

/* 渐变背景 */
.gradient-bg {
  background: linear-gradient(135deg, #f0f9ff 0%, #e6f3ff 100%);
}

/* 工具提示 */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 10;
}

/* 复制按钮动画 */
.copy-success {
  animation: fadeInOut 2s ease-in-out;
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  90% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

/* 差异高亮 */
.diff-highlight {
  background-color: rgba(239, 68, 68, 0.1);
  color: rgb(239, 68, 68);
}

/* 二进制视图 */
.binary-view {
  font-family: monospace;
  letter-spacing: 1px;
}

.binary-view span {
  display: inline-block;
  width: 8px;
  text-align: center;
}

/* 分布图表 */
.distribution-bar {
  height: 16px;
  background: #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.distribution-bar-fill {
  height: 100%;
  background: #3b82f6;
  transition: width 0.3s ease-in-out;
}

/* 动画控制 */
.animation-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.speed-select {
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #e5e7eb;
  background-color: white;
  font-size: 14px;
}

/* 全屏模式 */
.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  z-index: 50;
  overflow: auto;
  padding: 16px;
}

/* 响应式布局 */
@media (max-width: 640px) {
  .grid-cols-2 {
    grid-template-columns: 1fr;
  }

  .binary-view span {
    width: 6px;
    font-size: 12px;
  }
}

/* 加载动画 */
.loading {
  position: relative;
  width: 24px;
  height: 24px;
}

.loading::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border: 2px solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}